<?php
class Parser_Html_Google extends Parser_Html {
    
    
    public function need_redirect()
    {
        if (($qs = Arr::get($this->_url_info, 'query')))
        {
            parse_str($qs, $query);
            
            if (Arr::get($this->_url_info, 'path') == '/imgres')
            {
                if (($url = Arr::get($query, 'imgrefurl')))
                {
                    return $url;
                }
            }
            
            if (Arr::get($this->_url_info, 'path') == '/url')
            {
                if (($url = Arr::get($query, 'q')))
                {
                    if (substr($url, 0, 4) == 'http')
                    {
                        return $url;
                    }
                }
            }
        }
        return FALSE;
    }
    
    
}